﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Wwtfly.BBS.BackModels.Models.NewsType;
using Wwtfly.BBS.BackDAL.News;
using Wwtfly.LoggerUtility;

namespace Wwtfly.BBS.BackBLL.News
{
    /// <summary>
    /// 新闻类型..
    /// </summary>
    public class NewTypesBLL
    {
          /// <summary>
        /// 根据Id获取指定的NewsTypesModel
        /// </summary>
        /// <param name="Id">NewsTypesModel主键</param>
        /// <returns></returns>
        public static NewsTypesModel GetInfo(Int32 Id)
        {
            try
            {
                return NewTypesDAL.GetInfo(Id);
            }
            catch (Exception ex)
            {
                 LoggerManage.Error(new LogMessageParams()
                {
                    ModuleID = "NewTypesBLL",
                    FuncCode = "NewsTypesModel GetInfo(Int32 Id)",
                    Level = AppErrorLevel.EROR,
                    ErrCode = "0x0",
                    Excep = ex,
                    logMessage = " 获取 新闻类型信息.出错",
                    ProgramName = "Wwtilfy.BBS"
                });
                 return null;
            }
        }
        /// <summary>
        ///  获取 新闻类型
        /// </summary>
        /// <param name="pageParams">分页参数</param>
        /// <param name="searchModel">新闻搜索 实体类</param>
        /// <returns>分页后的结果</returns>
        public static IList<NewsTypesModel> GetNewsTypesList(string newsState = "0")
        {
            try
            {
                return NewTypesDAL.GetNewsTypesList(newsState);
            }
            catch (Exception ex)
            {
                LoggerManage.Error(new LogMessageParams()
                {
                    ModuleID = "NewTypesBLL",
                    FuncCode = "GetNewsTypesList(string newsState = \"0\")",
                    Level = AppErrorLevel.EROR,
                    ErrCode = "0x0",
                    Excep = ex,
                    logMessage = " 获取 新闻类型 的相关信息.出错",
                    ProgramName = "Wwtilfy.BBS"
                });
                return new List<NewsTypesModel>();
            }
        }
    }
}
